1. Field of the Invention
The present invention relates to an image processing technique required to execute light source estimation processing for estimating a color of a light source which illuminates an object in an input image.
2. Description of the Related Art
Conventionally, an image processing apparatus which executes light source estimation processing based on a dichromatic reflection model is known. Note that the dichromatic reflection model is a model which is designed so that reflected light from an object includes irregularly reflected light components depending on an object color and specular reflected light components depending on a light source color.
For example, Japanese Patent Laid-Open No. 2007-013415 discloses an image processing apparatus, which estimates a light source color by calculating a difference between pixel values at two points A and B which are located at adjacent positions in an input image and have a luminance difference, so as to extract only specular reflection components from reflected light from an object.
The light source estimation method disclosed in Japanese Patent Laid-Open No. 2007-013415 calculates a difference between pixel values under the assumption that adjacent pixels belong to the same object. However, with this method, at a boundary region of objects in an input image, a difference between pixel values of pixels which belong to different objects may be unwantedly calculated. Pixel value differences of pixels which belong to the same object represent specular reflection components corresponding to a light source color, but a difference calculated between objects having different colors depends on a difference between object colors and does not correspond to any light source color. In such case, the conventional method cannot accurately estimate a light source color.